namespace :api do
  resources :todos do
    collection do
      get :finished, :list
      delete :delete
    end
    member do
      put :toggle
    end
  end
  resources :stores, only: [:index]
  resources :store_friends, only: [:create] do
    collection do
      post :request
      put :agree
      get :friended
    end
    member do
      get :unfriend
    end
  end

  resources :store_staffs, only: [:show] do
    get :authenticate, on: :collection
  end

  resources :store_customers, only: [] do
    get :is_logged, on: :collection
  end

  resources :cart_items, only: [:create, :update, :destroy] do
    member do
      put :remove
    end
  end

  resources :store_products, only: [] do
    member do
      put :toggle
    end
  end

  resources :store_orders, only: [:create, :show] do
    member do
      put :confirm, :to_mail, :to_process, :cancel
    end
    collection do
      get :data
    end
  end

  resources :custom_products, only: [] do
    member do
      put :unuse
    end
  end

  resources :store_departments, only: [:create, :show, :update] do
    member do
      put :unuse
    end
    resources :store_positions, only: [:create, :update]
  end
  resources :store_adjust_salary_logs
  resources :store_staff_salaries, only: [:update]

  resource :translate, only: [:show]
end # api end
